import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login.vue'
import AdminMain from '../views/AdminMain.vue'
import BusinessMain from "../views/BusinessMain.vue";
import CommodityDetails from "../views/Member/CommodityDetails.vue";
import AdminCommodityDetails from "../views/Member/AdminCommodityDetails.vue";
import AuditDetails from "../views/Member/AuditDetails.vue";
import ApplyList from '../views/Member/ApplyList.vue'
import Landing from '../views/Member/landing.vue'
import BusinessList from '../views/Business/BusinessList.vue'
import Center from '../views/Center.vue'
import GoodsList from "../views/Business/GoodsList.vue";
import AddGoods from "../views/Member/AddGoods.vue";
Vue.use(Router);

export default new Router({
   mode:'history',   //历史模式，另一种模式是哈希模式，即目录中带#
   routes:[
     // landing页
     {
       path:'/landing',
       name:'landing',
       component:Landing
     },
     //登录页
     {
        path:'/login',
        name:'Login',
        component:Login
     },
     //用户中心
     {
       path:'/center',
       name:'Center',
       component:Center
     },
     //管理员首页
     {
        path:'/AdminMain',
        name:'AdminMain',
        component:AdminMain,
        children:[
            {
              //申请列表
              path:'/apply/list',
              name:'ApplyList',
              component: ApplyList
            },
            {
              //商家列表
              path:'/business/list',
              name:'BusinessList',
              component:BusinessList,
            },
            {
              path:'/goods/list',
              name:'GoodsList',
              component:GoodsList
            },
            {
              path:'/goods/details',
              name:'AdminCommodityDetails',
              component:AdminCommodityDetails
            },
            {
              path:'/goods/AuditDetails',
              name:'AuditDetails',
              component:AuditDetails
            },

        ]
     },
     // 商家首页
     {
       path: '/BusinessMain',
       name: 'BusinessMain',
       component: BusinessMain
     },
     // 商品详情页
     {
       path: '/goods/CommodityDetails',
       name: 'CommodityDetails',
       component: CommodityDetails
     },
     // 新建商品页
     {
       path: '/goods/addGoods',
       name: 'AddGoods',
       component: AddGoods
     },

     {
        path:'*',  // *是通配符
        // component:NotFound
       component:Landing
     }
   ]
})
